package com.woniuxy.platform.app.apiImpl;

import cn.hutool.core.bean.BeanUtil;
import com.woniuxy.platform.client.ApplyClient;
import com.woniuxy.platform.client.param.SearchApplyParams;
import com.woniuxy.store.client.StoreManageClient;
import com.woniuxy.store.client.StoreQueryClient;
import com.woniuxy.store.client.param.SearchApplyParam;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import result.Result;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.io.IOException;

@RestController
@RequestMapping("/platform")
public class ApplyClientImpl implements ApplyClient {

    @Resource
    private StoreManageClient storeManageClient;

    @Resource
    private StoreQueryClient storeQueryClient;

    @Override
    public Result handApply(Integer var1, String var2) throws IOException {
        return storeManageClient.handApply(var1, var2);
    }

    @Override
    public Result searchApply(@Valid SearchApplyParams var1) {
        SearchApplyParam param = BeanUtil.toBean(var1, SearchApplyParam.class);
        return storeQueryClient.searchApply(param);
    }
}
